import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'normalize.css/normalize.css'
import bfui from '../src/index'
import '../src/styles/componentStyle/index.scss'
import './assets/componentStyle/index.scss'
// 复制插件
import VueClipboard from 'vue-clipboard2'
// 导入代码高亮插件
import hljs from 'highlight.js'
import javascript from 'highlight.js/lib/languages/javascript'
import 'highlight.js/styles/github.css'
import './styles/highlight.scss'
import codeWrap from './components/codeWrap.vue'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import iconList from './iconList'
Vue.component('iconList', iconList)
Vue.component('codeWrap', codeWrap)
hljs.registerLanguage('javascript', javascript)
Vue.directive('highlight', function(el) {
  const blocks = el.querySelectorAll('pre code:not(.hljs)')
  blocks.forEach((block) => {
    hljs.highlightBlock(block)
  })
})
Vue.use(VueClipboard)
Vue.use(bfui)
Vue.config.productionTip = false
router.beforeEach((to, from, next) => {
  NProgress.start()
  next()
})
router.afterEach(() => {
  NProgress.done()
})
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')
